var productid=localStorage.getItem('productid')



console.log(productid)
let xhr1=new XMLHttpRequest()
var chanpin=document.querySelector('.chanpin')
xhr1.open('get',`http://chst.vip:1234/api/getmoneyctrlproduct?productid=${productid}`,true,)
xhr1.onload=function(){

    if(xhr1.status===200){
        var res2=JSON.parse(xhr1.responseText)
        //  console.log(res2.result)
    let regExp = /^<[^<]+\s+src="([^''""]*)"/;

         var lis2=''
        

         res2.result.forEach(function(so,ind){
         let tu1 = res2.result[ind].productImgSm.match(regExp)[1].split('=')[2];
         let tu2 = res2.result[ind].productImgLg.match(regExp)[1];
       console.log(tu1)
       console.log(tu2)
        lis2+=`
        <h4>${so.productName}</h4>
        
       
        <span class="sp1">${so.productFrom}</span>
        <span class="sp2">${so.productTime}</span>
        <span class="sp3">${so.productTips}</span>
        <p>${so.productInfo}</p>
        <img src="${tu1}" class="pic1">
        <img src="${tu2}" class="pic2">

      
          ${so.productCity}
       
         
          <button class="btn">前往购买</button>
          ${so.productComment}
        

        
       

     
       
       `
    })
 chanpin.innerHTML=lis2

  $('.icon-zuojiantou1').click(function(){
    location.href="./商品首页.html"
  })
}
   
}
   
xhr1.send(null)


// $('.bot span:nth-of-type(3)').click(function(){

//   document.documentElement.scrollTop = 0

// })
